﻿using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FurStudy.Core
{
    /// <summary>
    /// 审计（日志）类
    /// </summary>
    public class Audit: EntityBase
    {

        /// <summary>
        /// 表名
        /// </summary>
        public string Table { get; set; }

        /// <summary>
        /// 列名
        /// </summary>
        public string Column { get; set; }

        /// <summary>
        /// 新值
        /// </summary>
        public object NewValue { get; set; }

        /// <summary>
        /// 旧值
        /// </summary>
        public object OldValue { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 操作人Id
        /// </summary>
        public object UserId { get; set; }

        /// <summary>
        /// 操作方式
        /// </summary>
        public string Operate { get; set; }

        // ------------------------------------

        /// <summary>
        /// 审计人ID（非此表主键）
        /// </summary>
        public int AuditId { get; set; }
        /// <summary>
        /// 审计人姓名
        /// </summary>
        public string AuditName { get; set; }
        /// <summary>
        /// 审计时间
        /// </summary>
        public DateTime AuditTime { get; set; }
        /// <summary>
        /// 审计内容
        /// </summary>
        public string AuditContent { get; set; }
        /// <summary>
        /// 审计类型
        /// </summary>
        public AuditType AuditType { get; set; }
    }
    
    /// <summary>
    /// 审计类型
    /// </summary>
    public enum AuditType
    {
        新增 = 1,
        更新 = 2,
        删除 = 3
    }
}
